from langchain.chains.question_answering.map_rerank_prompt import output_parser
from langchain_community.llms.ollama import Ollama
from langchain_core.output_parsers import StrOutputParser
from langchain_core.prompts import ChatPromptTemplate

llm = Ollama(model="llama2")

prompt = ChatPromptTemplate.from_messages([
    ("system", "You are world class technical documentation writer."),
    ("user", "{input}")
])

output_parser = StrOutputParser()

chain = prompt | llm | output_parser
result = chain.invoke({"input": "how can langsmith help with testing?"})

print("结束了>>>>>>>>>>>>>>>")
print(result)
